import index from '../components/index'
import login from '../views/login'
import userLayout from "@/views/user/userLayout"
import userChat from "@/views/user/userChat"
import home from "@/views/user/home";
import lawyerList from "@/views/user/lawyerList";
import userCenter from "@/views/user/userCenter";
import userMessage from "@/views/user/userMessage";
import userChangeMessage from "@/views/user/userChangeMessage";
import buy from "@/views/user/buy";
import userSuggest from "@/views/user/userSuggest";
import register from "@/views/user/register";
import about from "@/views/user/about";
import lawyerLayout from "@/views/lawyer/lawyerLayout";
import lawyerHome from "@/views/lawyer/lawyerHome";
import lawyerChat from "@/views/lawyer/lawyerChat";
import lawyerCenter from "@/views/lawyer/lawyerCenter";
import lawyerMessage from "@/views/lawyer/lawyerMessage";
import lawyerChangeMessage from "@/views/lawyer/lawyerChangeMessage";
import lawyerBuy from "@/views/lawyer/lawyerBuy";
import lawyerSuggest from "@/views/lawyer/lawyerSuggest";
import lawyerCaseList from "@/views/lawyer/lawyerCaseList";
import lawyerAbout from "@/views/lawyer/lawyerAbout";
import adminLayout from "@/views/admin/adminLayout";
import adminHome from "@/views/admin/adminHome";
import userManager from "@/views/admin/userManager";
import caseManager from "@/views/admin/caseManager";
import lawyerManager from "@/views/admin/lawyerManager";
import statusManager from "@/views/admin/statusManager";
import adminCenter from "@/views/admin/adminCenter";
import adminAbout from "@/views/admin/adminAbout";
import adminMessage from "@/views/admin/adminMessage";
import caseList from "@/views/user/caseList";
import chat from "@/views/user/chat";
import lawyerRegister from "@/views/lawyer/lawyerRegister";
import chat1 from "@/views/lawyer/chat1";
import caseListManager from "@/views/admin/caseListManager";
import caseAddManager from "@/views/admin/caseAddManager";

const routes = [
    {
        path: '*',
        redirect: '/'
    },
    {
        path: '/',
        redirect: '/login'
    },
    {
        path: '/hello',
        name: "hello",
        component: index
    },
    {
        path: '/login',
        name: "login",
        component: login
    },
    {
        path: '/register',
        name: "register",
        component: register
    },
    {
        path: '/chat',
        name: "chat",
        component: chat
    },
    {
        path: '/chat1',
        name: "chat1",
        component: chat1
    },
    // 管理员模块及其子路由
    {
        path : '/adminLayout',
        redirect:'/adminHome',
        component: adminLayout,
        children: [
            {
                path: '/adminHome',
                name: "adminHome",
                component: adminHome
            },
            {
                path: '/userManager',
                name: "userManager",
                component: userManager
            },
            {
                path: '/caseManager',
                name: "caseManager",
                component: caseManager
            },
            {
                path: '/caseListManager',
                name: "caseListManager",
                component: caseListManager
            },
            {
                path: '/caseAddManager',
                name: "caseAddManager",
                component: caseAddManager
            },
            {
                path: '/statusManager',
                name: "statusManager",
                component: statusManager
            },
            {
                path: '/lawyerManager',
                name: "lawyerManager",
                component: lawyerManager
            },
            {
                path: '/adminCenter',
                name: "adminCenter",
                component: adminCenter
            },
            {
                path: '/adminAbout',
                name: "adminAbout",
                component: adminAbout
            },
            {
                path: '/adminMessage',
                name: "adminMessage",
                component: adminMessage
            },
        ]
    },
    // 律师模块及其子路由
    {
        path: '/lawyerLayout',
        redirect:'/lawyerHome',
        component: lawyerLayout,
        children: [
            {
                path: '/lawyerChat',
                name: "lawyerChat",
                component: lawyerChat
            },
            {
                path: '/lawyerCenter',
                name: "lawyerCenter",
                component: lawyerCenter
            },
            {
                path: '/lawyerRegister',
                name: "lawyerRegister",
                component: lawyerRegister
            },
            {
                path: '/lawyerMessage',
                name: "lawyerMessage",
                component: lawyerMessage
            },
            {
                path: '/lawyerChangeMessage',
                name: "lawyerChangeMessage",
                component: lawyerChangeMessage
            },
            {
                path: '/lawyerHome',
                name: "lawyerHome",
                component: lawyerHome
            },
            {
                path: '/lawyerBuy',
                name: "lawyerBuy",
                component: lawyerBuy
            },
            {
                path: '/lawyerSuggest',
                name: "lawyerSuggest",
                component: lawyerSuggest
            },
            {
                path: '/lawyerAbout',
                name: "lawyerAbout",
                component: lawyerAbout
            },
            {
                path: '/lawyerCaseList',
                name: "lawyerCaseList",
                component: lawyerCaseList
            },
            // {
            //     path: '/chat1',
            //     name: "chat1",
            //     component: chat1
            // },
        ]
    },


// 用户模块及其子路由
    {
        path: '/userLayout',
        redirect:'home',
        component: userLayout,
        children: [
            {
                path: '/userChat',
                name: "userChat",
                component: userChat
            },
            // {
            //     path: '/chat',
            //     name: "chat",
            //     component: chat
            // },
            {
                path: '/lawyerList',
                name: "lawyerList",
                component: lawyerList
            },
            {
                path: '/home',
                name: "home",
                component: home
            },
            {
                path: '/userCenter',
                name: "userCenter",
                component: userCenter
            },
            {
                path: '/userMessage',
                name: "userMessage",
                component: userMessage
            }, {
                path: '/userChangeMessage',
                name: "userChangeMessage",
                component: userChangeMessage
            },
            {
                path: '/buy',
                name: "buy",
                component: buy
            },
            {
                path: '/userSuggest',
                name: "userSuggest",
                component: userSuggest
            },
            {
                path: '/about',
                name: "about",
                component: about
            },
            {
                path: '/caseList',
                name: "caseList",
                component: caseList
            },

        ]
    }
]
export default routes
